import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//引入全局样式
import './assets/css/import.scss';

// echarts
import * as echarts from 'echarts' //5.0版本以上
Vue.prototype.$echarts = echarts

// Dialog
import "./assets/utils/dialogDrag";
ElementUI.Dialog.props.modal.default = false;
ElementUI.Dialog.props.closeOnClickModal.default = false;

// 公共组件引入
import './assets/icons';//svg图标引入
import paginationCom from '../src/components/paginationCom/index.vue'
import RightToolbar from '../src/components/RightToolbar/index.vue'
Vue.component('paginationCom', paginationCom)
Vue.component('RightToolbar', RightToolbar)

// axios
import api from './api/api';
import config from './api/config.js';//引入配置文件
Vue.prototype.$config = config
Vue.prototype.sendGet = api.sendGet
Vue.prototype.sendPost = api.sendPost

// ElementUI
import ElementUI from 'element-ui';//引入element-ui
import 'element-ui/lib/theme-chalk/index.css';//引入element-ui样式
Vue.use(ElementUI);

//公用成功提示
Vue.prototype.suc = function (config) {
  config.title = '提示';
  config.type = 'success';
  config.duration = 1000;
  ElementUI.Notification(config);
};
//公用失败提示
Vue.prototype.err = function (config) {
  config.title = '提示';
  config.type = 'error';
  config.duration = 2000;
  ElementUI.Notification(config);
};
//公用警告提示
Vue.prototype.warn = function (message) {
  let msgObj = {
    title: '提示',
    type: 'warning',
    message
  };
  ElementUI.Notification(msgObj);
};
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
